package com.company.creational.builder_patter.director;

import com.company.creational.builder_patter.builder.ActorBuilder;
import com.company.creational.builder_patter.product.Actor;

/**
 * 角色控制器,充当指挥者
 * @ClassName ActorController
 * @Author tiezheng.han
 * @Date 2020/8/27 11:41
 **/
public class ActorController {

    /**
     * 逐步构建复杂产品对象
     * @param actorBuilder
     * @return
     */
    public Actor construct(ActorBuilder actorBuilder){
        Actor actor;
        actorBuilder.buildType();
        actorBuilder.bulidSex();
        actorBuilder.bulidFace();
        actorBuilder.bulidCostume();
        actorBuilder.bulidHairstyle();
        actor = actorBuilder.createActor();
        return actor;
    }
}
